FROM php:7.4.19-fpm-alpine3.13

# 修改镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

# 安装依赖,核心扩展,pecl扩展,composer工具
RUN apk update && apk add --no-cache --virtual .build-deps \
    $PHPIZE_DEPS \
    rabbitmq-c-dev \
    git

RUN git clone --depth=1 -b v1.10.2 https://github.com/pdezwart/php-amqp.git /tmp/php-amqp && \
    cd /tmp/php-amqp && \
    phpize && ./configure && make && make install && \
    cd .. && rm -rf /tmp/php-amqp/ && \
    mkdir -p /etc/php7/conf.d/ && echo 'extension=amqp.so' >> /etc/php7/conf.d/amqp.ini